home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 October / enter-2005-10.iso / files / jedit42install.exe / {app} / macros / Files / Open_Selection.bsh < prev    next >
Encoding:
Text File  |  2004-08-29  |  1.5 KB  |  55 lines

  1. /*
  2.  * Open_Selection.bsh - a BeanShell macro script for the
  3.  * jEdit text editor - opens file named by selected text
  4.  * Copyright (C) 2001 Slava Pestov
  5.  *
  6.  * This program is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU General Public License
  8.  * as published by the Free Software Foundation; either version 2
  9.  * of the License, or any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with the jEdit program; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  *
  20.  * $Id: Open_Selection.bsh,v 1.4 2003/07/14 23:00:54 spestov Exp $
  21.  *
  22.  * Checked for jEdit 4.0 API
  23.  *
  24.  */
  25.  
  26. void openSelection()
  27. {
  28.     Selection[] selection = textArea.getSelection();
  29.     if(selection == null)
  30.         view.getToolkit().beep();
  31.     else
  32.     {
  33.         for(i = 0; i < selection.length; i++)
  34.             jEdit.openFile(view,textArea.getSelectedText(selection[i]));
  35.     }
  36. }
  37.  
  38. openSelection();
  39.  
  40. /*
  41.     Macro index data (in DocBook format)
  42.  
  43. <listitem>
  44.     <para><filename>Open_Selection.bsh</filename></para>
  45.     <abstract><para>
  46.         Opens the file named by the current buffer's selected text.
  47.     </para></abstract>
  48. </listitem>
  49.  
  50. */
  51.  
  52.  
  53. // end Open_Selection.bsh
  54.  
  55.